# @ModuleName: db_customer
# @Author: zxl
# @Time: 2024/6/17 16:40'
from quote.db.db_handle import DbHandle


class DbCustomer:
    def __init__(self):
        self.db_handle = DbHandle()

    def del_customer(self,customerNO):
        self.db_handle.update_query('delete from tb_customer where customerNO = %s',customerNO)

    def update_customer(self, customerNO, customerName, phone, address, relationman, otherInfo):
        sql = """  
            UPDATE tb_customer  
            SET customerName = %s, phone = %s, address = %s, relationman = %s, otherInfo = %s  
            WHERE customerNO = %s  
            """
        # 准备参数
        params = (customerName, phone, address, relationman, otherInfo, customerNO)
        # 调用 update_query 方法，假设它接受 SQL 语句和参数元组
        self.db_handle.update_query(sql, params)

    # db_customer = DbCustomer()
# db_customer.del_customer('000789')
